

<template>
  <view class="swiper-content">
    <u-swiper :list="list" height="320"  :current="swiperCurrent" @change="changeSwiper" autoplay circular></u-swiper>
    <view class="swiper-title">
      {{list ? list[swiperCurrent].title : ''}}
    </view>
  </view>
</template>

<script>
export default {
  name: "index",
  props:{
    list:{
      type:Array,
      default(){
        return []
      }
    }
  },
  data(){
    return{
      swiperCurrent:0
    }
  },
  methods:{
    changeSwiper(e){
      this.swiperCurrent = e.current
    }
  }
}
</script>

<style scoped lang="scss">
.swiper-content{
  background-color: rgba(255, 255, 255, 1);

  .swiper-title{
    text-align: center;
    margin-top: 10rpx;
    padding-bottom: 15rpx;
    position: relative;
    height: 20px;
    z-index: 1;
    font-size: 18px;
    font-weight: 700;
    line-height: 18px;
    color: rgba(0, 0, 0, 1);
  }
  .swiper-title::before{
    content:"";
    z-index: -1;
    position: absolute;
    width: 36px;
    height: 4px;
    opacity: 1;
    background: rgba(190, 46, 35, 1);
    bottom: 8px;
    left:50%;
    transform:translateX(-50%);
  }
}
</style>